package com.partsoft.dits.mq;

import java.util.Hashtable;

import org.springframework.beans.factory.InitializingBean;

import com.ibm.mq.MQC;
import com.ibm.mq.MQException;
import com.ibm.mq.MQQueueManager;

public class LocalBindMQConnectFactory extends AbstractMQConnectFactory implements MQConnectFactory,
		InitializingBean {
	
	public MQQueueManager getQueueManager(String name) throws MQException {
		Hashtable<Object, Object> hashtable = new Hashtable<Object, Object>(2);
		hashtable.put(MQC.CCSID_PROPERTY, getCCSID());
		hashtable.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_BINDINGS);
		return new MQQueueManager(name, hashtable);
	}

	public void afterPropertiesSet() {}

	public MQQueueManager getDefaultQueueManager() throws MQException {
		return getQueueManager(getDefaultQMName());
	}

}
